import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int a1 = a;
            int b1 = b;
            int c = a % b;
            while (c != 0) {
                a = b;
                b = c;
                c = a % b;
            }
            System.out.printf("%d %d\n", b, (a1 * b1) / b);
        }
    }
}
